package com.eunion;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;

import com.eunion.common.util.BoShiGxmd;

/**
 * 以WEB形式启动程序.
 * 修改启动类，继承 SpringBootServletInitializer 并重写 configure 方法.
 * 
 * @version 2015年7月22日
 */
public class WebStart extends SpringBootServletInitializer {

    private static Logger LOGGER = LoggerFactory.getLogger(WebStart.class);
    //http://stackoverflow.com/questions/30170586/how-to-disable-errorpagefilter-in-spring-boot
    public WebStart() {
        super();
        setRegisterErrorPageFilter(false); // <- this one
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        // ApplicationContext ctx = SpringApplication.run(new Class[] { AppStart.class,
        // ConfigServletContextListener.class }, args);
        return application.sources(AppStart.class);
    }
    
}
